<?php
require_once 'class/control.class.php';
ob_start();

	if($_GET['i']){
		echo '<div id="portfolio" >';
	}else{
		echo '<div id="destaque"  >';
	}
	?>
		<div class="list_carousel">
			<ul id="foo">
				<?php 
				$obj = new Control('destaques','cases',$_GET['i']);		
				$obj->Lister();
				?>
			</ul>
			<div class="clearfix"></div>
			<a id="prev" class="prev" href="#">&nbsp;</a>
			<a id="next" class="next" href="#">&nbsp;</a>
			<div id="pager" class="pager"></div>
		</div>
	</div>
	<?php 
	if($_GET['i']){
	?>
	<div class="chamada"></div>
	<br />
	<br />
	<div class="chamadab" style="float:right;"></div>
	<br class="clear" />
	<ul id="bolinhas" class="small" style="margin-right: -10px;float:right;">
 		<?php 
			$obj = new Control('bolinhas','categorias','');
			$obj->Lister();
		?>
 	</ul>
 	<br class="clear" />
 	<br /><br />
	<?php 
	}else{
	?>
	<div id="conteudo">
		<br /><br />
			<ul id="bolinhas" class="big" style="margin-left:160px;">
		 		<?php 
					$obj = new Control('bolinhas','categorias','');
					$obj->Lister();
				?>
		 	</ul>
		 	<div id="legenda"></div>
		<br class="clear" /><br /><br /><br /><br />
	</div>
	<?php 
	}
	?>
	<script type="text/javascript">
    	$(document).ready(function() {
    		$("ul.small li").hover(function() {
				$('.chamadab').text($(this).attr("rel"));
				Cufon.refresh();
			},function() {
				$('.chamadab').text('');
			});

    		$("ul#foo li").hover(function() {
				$('.chamada').text($(this).attr("rel"));
				Cufon.refresh();
			},function() {
				$('.chamada').text('');
			});

			$('.big li').hover(function() {
				var pos = $(this).position();
			    var width = $(this).outerWidth();
			    var txt = $(this).attr('rel');
			    
			    $("#legenda").css({
			        position: "absolute",
			        top: pos.top + 100 + "px",
			        left: (pos.left) + "px"
			    }).html(txt).show();

			    Cufon.refresh();
			},function() {
				$("#legenda").hide();				
			});

    		$("#foo").carouFredSel({
    			circular: false,
    			infinite: false,
    			auto 	: false,
    			prev	: {	
    				button	: "#prev",
    				key		: "left"
    			},
    			next	: { 
    				button	: "#next",
    				key		: "right"
    			},
    			pagination	: "#pager"
    		});
    		$('#pager a span').html('&bull;');
			
    		$('#foo li').click(function(){
				document.location.href = 'cases.php?i=' + $(this).attr('id');
        	});
    					
		});
	</script>
<?php 
$conteudo = ob_get_contents();
ob_get_clean();
include ("master.php");
?>	